
cc.Class({
    extends: cc.Component,

    properties: {
        socre:cc.Label,
        head:cc.Sprite,
        nickName:cc.Label,
        ready:cc.Node
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {

    },
    init(data){
        this.node.active = true;
        this.socre.string = data.score;
        this.nickName.string = data.nickName;
        this.updateState(data.state);
    },
    updateState(state){
        this.ready.active = state === 2 ? true : false;
    }

    // update (dt) {},
});
